home *** CD-ROM | disk | FTP | other *** search
- #include "progkit.h"
- #include "dim.h"
-
- void ProgramKit::exe(int)
- {
- if(used == 0)
- return;
-
- mouseShowCursor();
- moveTo(1);
-
- while(1)
- {
- if(!(list[current]->active()))
- WindowManager::show_window(list[current]);
- list[current]->exe();
-
- if(global_i[0])
- {
- if(global_i[0] > 100)
- {
- int w;
- if(!(w = application(global_i[0] + global_num - 1)))
- continue; // it is application function only
- if(w == 1) // it is too, but after execution hide
- { // this object and pass control to previous
- WindowManager::hide_window();
- moveTo(list[current]->isCall());
- continue;
- }
- // else --> it is not only application, we expect next menu
- }
- if(global_i[0] == AC_RESIZE || global_i[0] == AC_MOVE)
- {
- rect work = list[current]->bound();
- if(global_i[0] + global_num - 1 == AC_MOVE)
- work = get_dim(FIG_RECTANGLE,
- MOVE, list[0]->bound(), work,
- loc(work.width(), work.height()));
- else
- work = get_dim(FIG_RECTANGLE,
- RESIZE, list[0]->bound(), work,
- screenLocLT(minsize));
-
- WindowManager::redraw_window(work);
- continue;
- }
- }
-
- if(e.what == KEYEVENT || e.what == SHIFTKEYEVENT)
- {
- switch(e.key)
- {
- case EVENT_ALT_F3:
- if(list[current]->isRet(RET_REMOVE)
- && current > 1) // to hide
- {
- WindowManager::hide_window();
- delete remove(current);
- WindowManager::show_window(list[1]);
- moveTo(1);
- continue;
- }
- break;
- case EVENT_ALT_F4:
- // for(int i = s_used; i >= 0; i--)
- // delete remove(current);
- return;
- case EVENT_ALT_TAB: // go to the next object
- F6_shift();
- break;
- default: break;
- }
- }
- else
- if(e.mouse1())
- {
- if(!mouse_shift(e.where()))
- return;
- // if(res_cur == current && list[current]->isRet(RET_MOUSE))
- // return;
- }
- }
- }
-